package com.xbongbong.pro.formexplain.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.form.pojo.RuleTargetPojo;
import com.xbongbong.paas.field.LinkInfoPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;

/**
 * 通过规则过滤字段
 * @author 吴峰
 * @version 1.0
 * @date 2019-02-25 15:14
 * @since 1.0
 **/
@Getter
@Setter
@ToString
public class FilterExplainByRuleDTO extends BaseDTO {
    private static final long serialVersionUID = 3638981419138216862L;

    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.filterExplainByRule.appId.NotNull}")
    private Long appId;

    /**
     * 表单id
     */
    @NotNull(message = "{dto.msg.filterExplainByRule.menuId.NotNull}")
    private Long menuId;

    /**
     * 表单id
     */
    @NotNull(message = "{dto.msg.filterExplainByRule.formId.NotNull}")
    private Long formId;

    /**
     * 标签字段类型
     */
    @NotNull(message = "{dto.msg.filterExplainByRule.fieldType.NotNull}")
    private Integer fieldType;

    /**
     * @see com.xbongbong.saas.enums.XbbRefTypeEnum
     */
    private Integer businessType;

    /**
     * @see com.xbongbong.pro.enums.SaasMarkEnum
     */
    private Integer saasMark;
    
    /**
     * @see com.xbongbong.saas.enums.XbbRefTypeEnum
     */
    private Integer fromBusinessType;
    /**
     * 关联字段
     */
    private String linkAttr;

    private LinkInfoPojo linkInfo;

    private Integer linkedType;

    /**
     * 业务规则的目标表单
     */
    private RuleTargetPojo target;

    public FilterExplainByRuleDTO() {
    }

    public FilterExplainByRuleDTO(Long formId, Integer businessType, Integer saasMark, LinkInfoPojo linkInfo, Integer linkedType, String corpid) {
        this.formId = formId;
        this.businessType = businessType;
        this.saasMark = saasMark;
        this.linkInfo = linkInfo;
        this.linkedType = linkedType;
        setCorpid(corpid);
    }
}
